﻿@model Gfw.Web.Models.Stock.BuyModel
@{
    ViewBag.Title = "回购GP";
    Layout = "~/Areas/Stock/Views/Shared/_StockLayoutContent.cshtml";
}
@using (Html.BeginForm())
{
    <ul>
        <li>
            @Html.LabelFor(model => model.CurrentPrice)
        </li>
        <li>
            @Html.DisplayFor(model => model.CurrentPrice)
            @Html.HiddenFor(model => model.CurrentPrice)
        </li>
        <li>
            @Html.LabelFor(model => model.Balance)
        </li>
        <li>
            @Html.DisplayFor(model => model.Balance)
            @Html.HiddenFor(model => model.Balance)
        </li>
        <li>
            @Html.LabelFor(model => model.MaxCount)
        </li>
        <li>
            @Html.DisplayFor(model => model.MaxCount)
            @Html.HiddenFor(model => model.MaxCount)
        </li>
        <li>
            @Html.LabelFor(model => model.BuyCount)
        </li>
        <li>
            @Html.EditorFor(model => model.BuyCount)
            @Html.ValidationMessageFor(model => model.BuyCount)
            @Html.ValidationSummary(true)
        </li>
    </ul>
    <div class="button">
        @Html.ActionLink("返回", "Index")
        <input type="submit" value="买入" onclick="this.disabled = true; this.form.submit();"/>
    </div>
}
@{
    if (ViewBag.Done != null && ViewBag.Done)
    {
    <div id="dialog" title="Dialog Title">
        <h5>
            交易成功！</h5>
        <div>
            <button onclick="javascript:closedialog()">
                继续交易</button>
            @Html.ActionLink("返回首页", "Index")
        </div>
    </div>
    <script type="text/javascript">

        $(document).ready(function () {
            $("#dialog").dialog({ title: "操作提示", modal: true });
        });

        function closedialog() {
            $("#dialog").dialog("close");
        }
    </script>
    }
}
